#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main() {
    int n;
    int i, j, k;
    while (scanf("%d", &n) != EOF) {
        for (i = 0;i < n;i++)
        {
            if (0 == i || (n - 1) == i)
            {
                for (j = 0;j < n;j++)
                {
                    printf("* ");
                }
                printf("\n");
            }
            else
            {
                printf("* ");
                for (k = 0;k < n - 2;k++)
                {
                    printf("  ");
                }
                printf("*\n");
            }
        }
    }
    return 0;
}